#include<iostream>
using namespace std;
class Complex
{
private:
	double real;
	double imag;
public:
	Complex(double r, double i) :real(r), imag(i)
	{
		cout << "构造函数" << endl;
	}
	Complex Add(Complex &c);
	Complex Sub(Complex &c);
	void display();
};
Complex  Complex::Add(Complex& c)
{
	return Complex(real + c.real, imag + c.imag);
}
Complex Complex::Sub(Complex& c)
{
	return Complex(real - c.real, imag - c.imag);
}
void Complex::display()
{
	cout << "(" << real << "," << imag << ")" << endl;
}

int main()
{
	Complex c1(6.6, 6.6), c2(8.8, 8.8), c3(0.0,0.0);
	cout << "c1 = ";
	c1.display();
	cout << "c2 = ";
	c2.display();
	c3 = c1.Add(c2); // c3 = c1 + c2
	cout << "c1 + c2 = ";
	c3.display();
	c3 = c1.Sub(c2);// c3 = c1 - c2
	cout << "c1 - c2 = ";
	c3.display();
	return 0;
}